<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JS 的三种使用方式</title>
</head>

<body>
    <p onclick="javascript:alert('Hello!');">点击弹出hello</p>


    <script>
        const b = 8
        const c = 24
        var message = 'f这是来自变量的信息'
        console.log(message, b)
        console.log(message + c)
        console.log(b + c)
        if (b == c) {
            console.log('相等')
            console.log('不相等')
        }
        var category = 'rumor'
        switch (category) {
            case 'rumor':
                console.log('这是一个谣言')
                break;
            case 'true':
                console.log('确有此事')
                break;
            default:
                break;
        }
        for (let index = 0; index <= 9; index++) {
            console.log(index);
        }
        var i = 0
        while (i == 0) {
            console.log(i)
            i++
        }

        function name(params) {
            console.log(params)
        }
        name('hello')
        name('byebye')

        function score(url) {
            return 90;
        }
        console.log(score())

        var d = 'true';
        var e = true;
        console.log(d, e, typeof d, typeof e);

        var f;
        console.log(f, typeof f);
        console.log(b, typeof b);
        console.log(typeof c.toString())
        console.log(message.toUpperCase())
        d = '2'
        console.log(typeof Boolean(d), Boolean(d))

    </script>
    <!-- <script src="demo.js"></script> -->
</body>

</html>
